const defaultState = {
    loading: false,
    visible: false,
    dataSource: []
};
export default function exportLogList(state = defaultState, action) {
    const {type, payload, error} = action;
    switch (type) {

        case 'ZAD_ORDER_PAYABLE.QUERY_EXPORT_LOG':
            if (error === true) {
                return {...state, loading: false};
            }
            return {
                ...state,
                loading: false,
                dataSource: payload
            };
        case 'ZAD_ORDER_PAYABLE.SHOW_EXPORT_LOG':
            return {...state, visible: true, loading: true, dataSource: []};
        case 'ZAD_ORDER_PAYABLE.HIDE_EXPORT_LOG':
            return {...state, visible: false, loading: false, dataSource: []};
        default:
            return state;
    }
}

